package com.seven.restaurant.entity.request;

import com.seven.restaurant.annotation.ExistId;
import com.seven.restaurant.entity.po.OrderItemPO;
import com.seven.restaurant.mapper.UserMapper;
import lombok.Data;

import javax.validation.Valid;
import java.util.List;

/**
 * 订单请求
 * @author BaiBan
 * @since 2022/7/22
 */
@Data
public class OrderRequest {

    /**
     * 桌号
     */
    private Integer tableId;

    /**
     * 顾客编号
     */
    @ExistId(value = UserMapper.class, message = "用户编号不能为空")
    private Long userId;

    /**
     * 订单项
     */
    List<@Valid OrderItemPO> OrderItems;
}
